import { request, config } from "utils";
const { api } = config;
const { borrowList, applicationDetail, borrowSave, borrowUpdate, borrowAgain,borrowHistory, borrowHistoryDetails, workflowHistory} = api;

export async function query(params) {
  return request({
    url: borrowList,
    method: "post",
    data: params
  });
}

export async function getApplication(params) {
  return request({
    url: applicationDetail,
    method: "post",
    data: params
  });
}
//申请借阅
export async function applicationBorrow(params) {
  return request({
    url: borrowSave,
    method: "post",
    data: params
  });
}

//借阅申请、归还申请、归还审批
export async function getBorrowUpdate(params) {
  return request({
    url: borrowUpdate,
    method: "post",
    data: params
  });
}

//续借申请和审核
export async function borrowAgain1(params){
  return request({
    url:borrowAgain,
    method:"post",
    data:params
  })
}

//借阅历史列表
export async function borrowHistory1 (params) {
  return request({
    url:borrowHistory,
    method:'post',
    data:params
  })
}

//借阅历史详情
export async function borrowHistoryDetails1 (params){
  return request({
    url:borrowHistoryDetails,
    method:'post',
    data:params
  })
}

// 打印借阅审批流程
export async function workflowHistory1 (params){
  return request({
    url:workflowHistory,
    method:'post',
    data:params
  })
}